#include "Student_info.h"

using namespace std;

//TODO
bool compare(const Student_info &x, const Student_info &y){
    return x.name<y.name;
}
std::istream & read(std::istream & is, Student_info &s){
    is>>s.name>>s.midterm>>s.final;
    read_hw(is,s.homework);
    return is;
}
std::istream & read_hw(std::istream & in, std::vector<double> & hw){
    hw.clear();
    if (in){
        double x;
        while(in>>x){
            hw.push_back(x);
            if(cin.get() == '\n') break;
        }
        in.clear();
    }
    return in;
}